import { defineConfig } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    rollupOptions: {
      external: ['jquery'],
      output: {
        globals: {
          'jquery': '$'
        }
      }
    }
  },
  plugins: [vue()],
  optimizeDeps: {
    include: ['jquery'] // 确保jQuery被优化依赖项插件包括进来
  },
  resolve: {
    // dedupe: ['vue'],
    //别名配置，引用src路径下的东西可以通过@如：import Layout from '@/layout/index.vue'
    alias: [
      {
        find: '@',
        replacement: resolve('src')
      }
    ]
  },
})
